<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/goods/Good_Thing.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/goods/Good_Thing.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Goodsid',
                footer: "Foots",
                cnName: '商品信息表',
                name: 'goods/Good_Thing',
                url: "/Good_Thing/",
                sortName: "Goodsid"
            });
            const editFormFields = ref({"GoodsName":"","GoodsPrice":"","GoodsCode":"","GoodsTypeId":"","GoodsImg":""});
            const editFormOptions = ref([[{"title":"商品名称","field":"GoodsName"},
                               {"title":"商品价格","field":"GoodsPrice","type":"decimal"},
                               {"title":"商品编码","field":"GoodsCode"},
                               {"dataKey":"商品分类下拉框","data":[],"title":"商品分类id","field":"GoodsTypeId","type":"select"}],
                              [{"title":"商品照片","field":"GoodsImg","type":"img"}]]);
            const searchFormFields = ref({"GoodsName":"","GoodsPrice":"","GoodsCode":"","GoodsTypeId":""});
            const searchFormOptions = ref([[{"title":"商品名称","field":"GoodsName","type":"like"}],[{"title":"商品价格","field":"GoodsPrice","type":"like"},{"title":"商品编码","field":"GoodsCode","type":"like"},{"dataKey":"商品分类下拉框","data":[],"title":"商品分类id","field":"GoodsTypeId","type":"select"}]]);
            const columns = ref([{field:'Goodsid',title:'商品id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'GoodsName',title:'商品名称',type:'string',link:true,sort:true,width:110,align:'left',sort:true},
                       {field:'GoodsPrice',title:'商品价格',type:'decimal',width:110,align:'left'},
                       {field:'GoodsImg',title:'商品照片',type:'img',width:220,align:'left'},
                       {field:'GoodsCode',title:'商品编码',type:'string',width:110,align:'left'},
                       {field:'GoodsTypeId',title:'商品分类id',type:'int',bind:{ key:'商品分类下拉框',data:[]},width:80,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
